package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.ActivityScope;
import com.wgts.wgts.mvp.model.IBindPhoneActivityModel;
import com.wgts.wgts.mvp.model.ISendSMSCodeModel;
import com.wgts.wgts.mvp.model.imp.BindPhoneActivityModel;
import com.wgts.wgts.mvp.model.imp.SendSMSCodeModel;
import com.wgts.wgts.mvp.presenter.IBindPhoneActivityPersenter;
import com.wgts.wgts.mvp.presenter.imp.BindPhoneActivityPersenter;
import com.wgts.wgts.mvp.view.IBindPhoneActivityView;
import com.wgts.wgts.netmodle.NetService;
import com.wgts.wgts.tools.CountDownTime;
import com.wgts.wgts.tools.SharedpreferencesHelper;

import dagger.Module;
import dagger.Provides;

@Module
public class BindPhoneActivityModule {

    private IBindPhoneActivityView view;

    public BindPhoneActivityModule(IBindPhoneActivityView view) {
        this.view = view;
    }

    @Provides
    @ActivityScope
    public IBindPhoneActivityView provideView(){
        return view;
    }

    @Provides
    @ActivityScope
    public IBindPhoneActivityModel provideModel(NetService netService, SharedpreferencesHelper sharedpreferencesHelper){
        return new BindPhoneActivityModel(netService, sharedpreferencesHelper);
    }

    @Provides
    @ActivityScope
    public ISendSMSCodeModel provideSmsModel(NetService netService, CountDownTime countDownTime){
        return new SendSMSCodeModel(netService, countDownTime);
    }

    @Provides
    @ActivityScope
    public IBindPhoneActivityPersenter providePersenter(IBindPhoneActivityModel model, IBindPhoneActivityView view, ISendSMSCodeModel sendSMSCodeModel){
        return new BindPhoneActivityPersenter(model, view, sendSMSCodeModel);
    }
}
